<?php
require_once dirname(__FILE__).'/../Constants.php';

/**
 * Contains the properties of a field
 */
class FieldProperties {
	/**
	 * A field designator for the field name
	 */
	var $field_name;
	
	/**
	 * A field designator for potential data types
	 * integer
	 * double
	 * float
	 * string
	 */
	var $data_type;
	
	/**
	 * A field designator for if this field is allowed to be null.
	 * Values: YES, NO
	 */
	var $nullable;
	
	/**
	 * A field designator for the index.
	 * Currently only PRI and MUL.
	 * PRI: a primary key index
	 * MUL: a multiple value index
	 */
	var $index;
	
	/**
	 * A field designator for the default value of the field
	 */
	var $default_value;
	
	/**
	 * A field designator of special, currently only auto_increment
	 */
	var $special;
	
	/**
	 * MySQL designation for a comments field
	 */
	var $comments;
	
	function FieldProperties($field_properties) {
		$this->field_name = $field_properties[FIELD_NAME_FIELD];
		$this->data_type = $field_properties[DATA_TYPE_FIELD];
		$this->nullable = $field_properties[NULLABLE_FIELD];
		$this->index = $field_properties[INDEX_FIELD];
		$this->default_value = $field_properties[DEFAULT_VALUE_FIELD];
		$this->special = $field_properties[SPECIAL_FIELD];
		$this->comments = $field_properties[COMMENTS_FIELD];
	}
	
}

?>